﻿@{
    ViewBag.Title = @ViewBag.UserName+"的地址列表";
    ViewBag.PathToBtn = "/UserAddress/Create/" + @ViewBag.Id;
    ViewBag.TextBtn = "添加新的默认地址";
    Layout = "~/Views/Shared/_Layout.cshtml";

}
@section css{
    <style type="text/css">
        .nav-tabs li {
            cursor: pointer;
        }

        .table hr {
            margin: 5px 0;
            border: dashed 1px #aaa;
        }

        .dataTables_length {
            display: none;
        }

        .dataTables_filter {
            display: none;
        }
    </style>
}
<!-- /.row -->
<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-heading">
               <span>@ViewBag.UserName</span>的地址列表
            </div>
            <!-- /.panel-heading -->
            <div class="panel-body">
                <div class="dataTable_wrapper">
                    <table width="100%" class="table table-striped table-bordered table-hover" id="dataTables-example">
                        <thead>
                            <tr>
                                <th>姓名</th>
                                <th>电话</th>
                                <th>地址</th>
                                <th>地址门牌号等详情</th>
                                <th>是否默认地址</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody></tbody>
                    </table>

                </div>
                <!-- /.table-responsive -->
            </div>
            <!-- /.panel-body -->
        </div>
        <!-- /.panel -->
    </div>
    <!-- /.col-lg-12 -->
</div>
@section javascript{
    <script src="/Content/admin/dist/js/pagingHelper.js"> </script>
    <script type="text/javascript">
        var id=@ViewBag.Id;
        var dataParams = {id:id};
        var serverProcessPath = "/UserAddress/Listing";
        var showColumns = [
            { data: "LinkMan" },
            { data: "LinkMobile" },
            { data: "Address" },
            { data: "AddressDetail" },
            { data: "IsDefaultStr" },
            { data: "Action" }
        ];
        pagingHelper.Paging(serverProcessPath, dataParams, showColumns);
        function SetDefaultAddress(id) {
            document.location.href = "/UserAddress/SetDefaultAddress/" + id;
        }

        function Edit(id) {
            document.location.href = "/UserAddress/Update/" + id;
        }
    </script>
}